<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.domain.ZhongLei,java.util.ArrayList,com.domain.*"%>

<%
YongHu yonghu=(YongHu)session.getAttribute("yonghu");
ArrayList<ZhongLei> quanbuzhonglei=(ArrayList<ZhongLei>)session.getAttribute("quanbuzhonglei");
ZhongLei zhonglei;
if(yonghu==null || !yonghu.getQuanxian().equals("guanliyuan"))
{
	request.getRequestDispatcher("guanliyuandenglu.jsp").forward(request, response);
}
if(quanbuzhonglei==null)
{
	request.getRequestDispatcher("Huoquleiming").forward(request, response);
}

String tianjiazhongleizhuangtai=(String)session.getAttribute("tianjiazhongleizhuangtai");
session.removeAttribute("tianjiazhongleizhuangtai");
%>

<html>
  <head>
	  <style>A{text-decoration: NONE} </style>
	  <title>后台商品分类</title>
  </head>
  <body>
 	
 	<table width="80%" align="center" border="1" bgcolor="#d0eed8">
<%
	if(tianjiazhongleizhuangtai!=null)
	{
%>
		<tr height="200">
			<td align="center" colspan="2"><font size="7"><%=tianjiazhongleizhuangtai%></font></td>			
		</tr>
<%		
	}
%>
		<tr height="200">
			<td align="center" colspan="2"><font size="7"><a href="houtaishouye.jsp">返回首页</a></font></td>			
		</tr>
		<form action="Tianjiafenlei" method="post">
			<tr height="100">
				<td align="center" width="50%"><font size="5" >类名：<input name="mingzi"  type="text"/></font></td>
				<td align="center" rowspan="2"><font size="7"><input name="submit1" value="添加分类" type="submit" style="width:150;height:60;"/></font></td>			
			</tr>
			<tr height="100">
				<td align="center"><font size="5" >编号：<input name="bianhao"  type="text" placeholder="5个字符  字母开头"/></font></td>
			</tr>
		</form>	
	</table>
<%
	for(int i=0;i<quanbuzhonglei.size();i++)
	{
		zhonglei=quanbuzhonglei.get(i);
%>
 	<table width="80%" align="center" border="1" bgcolor="#d0eed8">
		<tr height="100">
			<td align="center" rowspan="2" width="50%"><font size="7"><%=zhonglei.getMingzi() %></font></td>
			<td align="center" ><font size="5"><a href="Huoqushangpin?zhongleibiaoming=<%=zhonglei.getBianhao()%>">管理商品</a></font></td>			
		</tr>
		<tr height="100">
			<td align="center"><font size="5"><a href="Shanchufenlei?zhongleibianhao=<%=zhonglei.getBianhao() %>">删除分类</a></font></td>			
		</tr>
	</table>

<%		
	}
%>

  </body>
</html>
